"""
@name : 5-2.多进程-数据共享-Manager
@author : wenyao
@projectname: sanchuanglianxi
"""

from multiprocessing import Process
from multiprocessing import Manager

def func(i, temp):
    temp[0] += 100
    print(i, "------->",temp[0])

if __name__ == "__main__":
    mange = Manager()
    p_list = []
    temp = mange.list([11,22,33])
    #temp = [11,22,33]
    for i in range(3):
        p = Process(target = func, args = (i,temp))
        p.start()
        p_list.append(p)
    #一定要加join,等待子进程结束。
    [p.join() for p in p_list]